package demo5;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-09-06
 * Time: 10:35
 */
public class CloneTest {
    public static void main(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("张三",11);
        Person person2 = (Person) person1.clone();

        System.out.println("修改之前："+ person1.m.money);
        System.out.println("修改之前："+ person2.m.money);

        person1.m.money = 99.99;

        System.out.println("修改之后："+ person1.m.money);
        System.out.println("修改之后："+ person2.m.money);
    }
}
